Crate rsass[][src]

Expand description

Sass reimplemented in rust (not yet complete).

The “r” in the name might stand for the Rust programming language, for “re-implemented”, or possibly for my name Rasmus.

Example

use rsass::{compile_scss_path, output};

let path = "tests/basic/14_imports/a.scss".as_ref();
let format = output::Format {
    style: output::Style::Compressed,
    .. Default::default()
};
let css = compile_scss_path(path, format).unwrap();

assert_eq!(css, b"div span{moo:goo}\n")

Sass language and implemetation status

The sass language is defined in its reference doc. This implementation is incomplete but getting there, if slowly.

Progress: 4002 of 6180 tests passed in dart-sass compatibility mode.

If you want a working rust library for sass right now, you may be better of with sass-rs or sass-alt, which are rust wrappers around libsass. Another alternative is grass which is another early stage pure rust implementation. That said, this implementation has reached a version where I find it usable for my personal projects, and the number of working tests are improving.

Modules

Types for css values and rules.

Types describing how to format output.

Value and Item types (and some supporting) for sass.

This module contains types for the selectors of a rule.

Types used in sass and css values.

Structs

A filesystem file context specifies where to find local files.

An error encountered when parsing sass.

Variables, functions and mixins are defined in a Scope.

The name of a scss source file.

A position in sass input.

Enums

Most functions in rsass that returns a Result uses this Error type.

A static or dynamic scope referece.

Traits

A file context manages finding and loading files.

Functions

Parse scss data from a buffer and write css in the given style.

Parse a file of scss data and write css in the given style.

Parse a scss value from a buffer and write its css representation in the given format.

Parse scss data from a buffer.

Parse a scss file.

Parse a scss file by path.

Parse a scss value.